<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>优标检测网</title>
    <!-- 浏览器上显示title 图标 icon图标 -->
	<link type="image/x-icon" rel="icon" href="<%=basePath %>resource/img/minilogo.png">

	<!-- 如果想让图标出现在收藏夹中，就：  -->
	<link type="image/x-icon" rel="shortcut icon" href="<%=basePath %>resource/img/minilogo.png">
	<link type="image/x-icon" rel="bookmark" href="<%=basePath %>resource/img/minilogo.png">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="优标">
	<meta http-equiv="description" content="优标">
    <link href="<%=basePath %>portal/css/main.css" type="text/css" rel="stylesheet">
    <link href="<%=basePath %>portal/css/datepickerbootstrap.css" type="text/css" rel="stylesheet">
    <title>上传标准</title>
</head>
<body>
<%@include file="p_head.jsp"%>
<div class="NCContent">
    <div class="NCNewsHead">
        <div class="MainPage">
            <div class="NCMain">
                <h2 class="NCHeadWord">质量控制 / Quality Control</h2>
            </div>
        </div>
    </div>
    <div class="NCNewsList">
        <div class="MainPage">
            <div class="NCMain">
                <div class="NCNewsListContent">
                    <div class="QCTitleContentHead">上传标准</div>
                    <a href="javascript:history.back()" class="SCBackBtn">返回</a>
                    <div class="QCCreateBody">
                        <div class="QCCreateContent">
                        <form action="<%=basePath%>standard_doCreate.action" method="post" id="standardForm" enctype="multipart/form-data">
                            <div class="QCCreateBox">
                                <div class="QCCreateHeadWord1">标准名称</div>
                                <div class="QCCreateMain"><input class="SCName" type="text" id="standardName" name="standardName"/>
                                <span style="display:none" class="RegMsg">*标准名称不能为空</span></div>
                                <span class="SCTips">（提示：标准编号 + 标准名称）</span></div>
                            <div class="QCCreateBox">
                                <div class="QCCreateHeadWord1">类型</div>
                                <div class="QCCreateMain">
                                    <select class="SCTag" name="type">
                                        <c:forEach var="type" items="${standardTypeStr}">
                                        	<option value="${type.dicKey}">${type.dicValue}</option>
										</c:forEach>
                                    </select>
                                </div>
                            </div>
                            <div class="QCCreateBox">
                                <div class="QCCreateHeadWord1">领域</div>
                                <div class="QCCreateMain">
                                    <select class="SCTag" name="field">
                                        <c:forEach var="field" items="${standardFieldStr}">
                                        	<option value="${field.dicKey}">${field.dicValue}</option>
										</c:forEach>
                                    </select>
                                </div>
                            </div>
                            <div class="QCCreateBox2">
                                <div class="QCCreateHeadWord1">附件</div>
                                <div class="QCCreateMain2">
                                    <input class="QCCUpload" type="file" name="stdfile" id="stdfile"/>
                                    <span style="display:none;" class="RegMsg">*附件不能为空</span>
                                </div>
                            </div>
						</form>
                        </div>
                        <div class="QCCSubmitBox">
                            <span class="BtnCss QCCSubmitBtn">提&nbsp;交</span>
                        </div>
                        <div style="clear:both"></div>
                    </div>
                    <div class="NCNewsListContentFoot"></div>
                </div>
                <div class="NCNewsListAds">
                    <div class="NCNewsListAdsBox"><a href="${adLeft.adUrl}" target="_blank"><img src="<%=basePath%>${adLeft.file.path}"/></a></div>
                    <div class="NCNewsListAdsBox"><a href="${adMid.adUrl}" target="_blank"><img src="<%=basePath%>${adMid.file.path}"/></a></div>
                    <div class="NCNewsListAdsBox"><a href="${adRight.adUrl}" target="_blank"><img src="<%=basePath%>${adRight.file.path}"/></a></div>
                </div>
            </div>
        </div>
    </div>
</div>
<%@include file="p_foot.jsp"%>
</body>
<script src="<%=basePath %>portal/js/res/jquery-1.4.2.min.js"></script>
<script src="<%=basePath %>portal/js/res/responsiveslides.min.js"></script>
<script src="<%=basePath %>portal/js/res/zebra_datepicker.src.js"></script>
<script src="<%=basePath %>portal/js/page/base.js"></script>
<script src="<%=basePath %>portal/js/page/standard.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script src="<%=basePath %>admin/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<script>
$('#standardForm').form({
    onSubmit: function() {
        return $(this).form('validate');
    },
    success: function(data) {
		var mydata = JSON.parse(data);
		switch(mydata.result) {
		case 0:
			window.location="<%=basePath%>standard_index.action";
			break;
		case 1:
			$("#standardName").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		case 2:
		case 3:
		case 4:
		case 5:
			$("#stdfile").parent().find(".RegMsg").html(mydata.msg).show();
			break;
		}
	}
});
$(".QCCSubmitBtn").click(function(){
	var flag = true;
    flag = checkname();
    flag = checkfile();
    
	if (flag)
		$('#standardForm').submit();
});

$("#stdfile").blur(function() {
	//if ($("#stdfile").val() != "")
		checkfile();
});
</script>
</html>